/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.enrstu.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
* @website https://eladmin.vip
* @description /
* @author yyx
* @date 2024-10-22
**/
@Entity
@Data
@Table(name="param_administrative_division")
public class AdministrativeDivision implements Serializable {

    @Id
    @Column(name = "`id`")
    @ApiModelProperty(value = "id")
    private String id;

    @Column(name = "`administrative_division_name`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "行政区名")
    private String administrativeDivisionName;

    @Column(name = "`administrative_division_id`",unique = true,nullable = false)
    @NotNull
    @ApiModelProperty(value = "行政区代码编号")
    private Long administrativeDivisionId;

    @Column(name = "`administrative_division_parent_id`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "上级行政区代码编号")
    private Long administrativeDivisionParentId;

    @Column(name = "`administrative_division_level`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "行政地区等级")
    private Integer administrativeDivisionLevel;

    @Column(name = "`administrative_division_sign`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "行政地区标志")
    private Integer administrativeDivisionSign;
    public void copy(AdministrativeDivision source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
